<!DOCTYPE html>
<html>
  <head><meta name="generator" content="Hexo 3.8.0">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="fengzhaoyang&#39;s blog">
  <meta name="keyword" content="hexo-theme, vuejs">
  
  <link rel="shortcut icon" href="/css/images/logo.png">
  
  <title>
    
    教育平台表设计 | fzy-blog
    
  </title>
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/tomorrow.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/css/style.css">
  
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"></script>
  
  <script src="/js/qrious.js"></script>
  
  
  
  
    <!-- MathJax support START -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <!-- MathJax support END -->
  


</head>
<div class="wechat-share">
  <img src="/css/images/logo.png">
</div>
  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>fzy-blog</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link">Home</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">Tags</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">Archives</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/project/" class="item-link">Projects</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">About</a>
          
        </li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link">Home</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">Tags</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">Archives</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/project/" class="menu-link">Projects</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">About</a>
            
          </li>
        
      </ul>
    </div>
  </div>
</header>

    <div id="article-banner">
  <h2>教育平台表设计</h2>
  <p class="post-date">2019-05-24</p>
  <div class="arrow-down">
    <a href="javascript:;"></a>
  </div>
</div>
<main class="app-body flex-box">
  <!-- Article START -->
  <article class="post-article">
    <section class="markdown-content"><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_article`</span> (</span><br><span class="line">  <span class="string">`article_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'文章id'</span>,</span><br><span class="line">  <span class="string">`title`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章标题'</span>,</span><br><span class="line">  <span class="string">`summary`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章摘要'</span>,</span><br><span class="line">  <span class="string">`key_word`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章关键字'</span>,</span><br><span class="line">  <span class="string">`image_url`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章图片url'</span>,</span><br><span class="line">  <span class="string">`source`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章来源'</span>,</span><br><span class="line">  <span class="string">`author`</span> <span class="built_in">varchar</span>(<span class="number">10</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章作者'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章创建时间'</span>,</span><br><span class="line">  <span class="string">`publish_time`</span> datetime <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章发布时间'</span>,</span><br><span class="line">  <span class="string">`link`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'文章访问链接'</span>,</span><br><span class="line">  <span class="string">`article_type`</span> <span class="built_in">tinyint</span>(<span class="number">4</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'文章类型 2文章'</span>,</span><br><span class="line">  <span class="string">`click_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'文章点击量'</span>,</span><br><span class="line">  <span class="string">`praise_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'点赞数量'</span>,</span><br><span class="line">  <span class="string">`comment_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'评论数'</span>,</span><br><span class="line">  <span class="string">`sort`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'排序值'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`article_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'文章信息表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_article_content`</span> (</span><br><span class="line">  <span class="string">`article_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'文章id'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'文章内容'</span></span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'文章内容表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_comment`</span> (</span><br><span class="line">  <span class="string">`comment_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'评论表'</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`p_comment_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'父级评论id(为0则是一级评论,不为0则是回复)'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">varchar</span>(<span class="number">1000</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'评论内容'</span>,</span><br><span class="line">  <span class="string">`addtime`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建时间'</span>,</span><br><span class="line">  <span class="string">`other_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'评论的相关id'</span>,</span><br><span class="line">  <span class="string">`praise_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'点赞数量'</span>,</span><br><span class="line">  <span class="string">`reply_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'回复数量'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'1文章 2课程'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`comment_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci ;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course`</span> (</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'课程编号'</span>,</span><br><span class="line">  <span class="string">`course_name`</span> <span class="built_in">varchar</span>(<span class="number">300</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'课程名称'</span>,</span><br><span class="line">  <span class="string">`is_avaliable`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'1正常2删除'</span>,</span><br><span class="line">  <span class="string">`subject_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程专业id'</span>,</span><br><span class="line">  <span class="string">`subject_link`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'课程专业链'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  <span class="string">`source_price`</span> <span class="built_in">decimal</span>(<span class="number">10</span>,<span class="number">2</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0.00'</span> <span class="keyword">comment</span> <span class="string">'课程原价格（只显示）'</span>,</span><br><span class="line">  <span class="string">`current_price`</span> <span class="built_in">decimal</span>(<span class="number">10</span>,<span class="number">2</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0.00'</span> <span class="keyword">comment</span> <span class="string">'课程销售价格（实际支付价格）设置为0则可免费观看'</span>,</span><br><span class="line">  <span class="string">`title`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'课程简介'</span>,</span><br><span class="line">  <span class="string">`context`</span> longtext <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'课程详情'</span>,</span><br><span class="line">  <span class="string">`lession_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'总课时'</span>,</span><br><span class="line">  <span class="string">`logo`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'图片路径'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> datetime <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'最后更新时间'</span>,</span><br><span class="line">  <span class="string">`page_buycount`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'销售数量'</span>,</span><br><span class="line">  <span class="string">`page_viewcount`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'浏览数量'</span>,</span><br><span class="line">  <span class="string">`end_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'有效结束时间'</span>,</span><br><span class="line">  <span class="string">`losetype`</span> <span class="built_in">int</span>(<span class="number">2</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'有效期类型，0：到期时间，1：按天数'</span>,</span><br><span class="line">  <span class="string">`lose_time`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'有效期:商品订单过期时间点'</span>,</span><br><span class="line">  <span class="string">`sequence`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'序列'</span>,</span><br><span class="line">  <span class="string">`course_gross_income`</span> <span class="built_in">decimal</span>(<span class="number">10</span>,<span class="number">2</span>) <span class="keyword">default</span> <span class="string">'0.00'</span> <span class="keyword">comment</span> <span class="string">'该课程总共卖了多少钱（新加字段暂时没用到）'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`course_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'课程表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_favorites`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建时间'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`user_id`</span> (<span class="string">`user_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'收藏'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_kpoint`</span> (</span><br><span class="line">  <span class="string">`kpoint_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`name`</span> <span class="built_in">varchar</span>(<span class="number">300</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'节点名称'</span>,</span><br><span class="line">  <span class="string">`parent_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'父级id'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  <span class="string">`sort`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'显示排序'</span>,</span><br><span class="line">  <span class="string">`play_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'播放次数'</span>,</span><br><span class="line">  <span class="string">`is_free`</span> <span class="built_in">tinyint</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'是否可以试听1免费2收费'</span>,</span><br><span class="line">  <span class="string">`video_url`</span> <span class="built_in">varchar</span>(<span class="number">500</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'视频地址'</span>,</span><br><span class="line">  <span class="string">`teacher_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'讲师id'</span>,</span><br><span class="line">  <span class="string">`play_time`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'播放时间'</span>,</span><br><span class="line">  <span class="string">`kpoint_type`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'节点类型 0文件目录 1视频'</span>,</span><br><span class="line">  <span class="string">`video_type`</span> <span class="built_in">varchar</span>(<span class="number">30</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'视频类型'</span>,</span><br><span class="line">  <span class="string">`file_type`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'video视频 audio音频 file文档 txt文本 atlas图片集'</span>,</span><br><span class="line">  <span class="string">`content`</span> longtext <span class="keyword">comment</span> <span class="string">'文本'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`kpoint_id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`course_id`</span> (<span class="string">`course_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'知识点的基本信息'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_note`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`kpoint_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'节点id'</span>,</span><br><span class="line">  <span class="string">`content`</span> longtext <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'笔记信息'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> datetime <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'修改时间'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">4</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'0公开1隐藏'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`cus_id`</span> (<span class="string">`kpoint_id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`point_id`</span> (<span class="string">`course_id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`user_id`</span> (<span class="string">`user_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'笔记信息'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_studyhistory`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`kpoint_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'节点id'</span>,</span><br><span class="line">  <span class="string">`playercount`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'观看次数,累加'</span>,</span><br><span class="line">  <span class="string">`course_name`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'课程名称'</span>,</span><br><span class="line">  <span class="string">`kpoint_name`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'节点名称'</span>,</span><br><span class="line">  <span class="string">`databack`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'playercount小于20时记录,备注观看的时间，叠加'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> datetime <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'最后观看时间'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`user_course_id`</span> (<span class="string">`user_id`</span>,<span class="string">`course_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'课程播放记录(学习记录)'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_subject`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`subject_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'分类id'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">unique</span> <span class="keyword">key</span> <span class="string">`course_subject`</span> (<span class="string">`course_id`</span>,<span class="string">`subject_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci ;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_course_teacher`</span> (</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`teacher_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'讲师id'</span>,</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`course_id`</span> (<span class="string">`course_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'课程讲师关联'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_emailsend_history`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`email`</span> longtext,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span>,</span><br><span class="line">  <span class="string">`title`</span> <span class="built_in">varchar</span>(<span class="number">300</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'邮箱标题'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'邮箱正文'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">default</span> <span class="string">'0000-00-00 00:00:00'</span>,</span><br><span class="line">  <span class="string">`send_time`</span> datetime <span class="keyword">default</span> <span class="string">'0000-00-00 00:00:00'</span> <span class="keyword">comment</span> <span class="string">'定时发送时间'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'1'</span> <span class="keyword">comment</span> <span class="string">'1 已发送 2 未发送'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'1'</span> <span class="keyword">comment</span> <span class="string">'1 普通 2 定时'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`type`</span> (<span class="string">`type`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`status`</span> (<span class="string">`status`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'邮件发送记录'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_mobilesend_history`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`mobile`</span> <span class="built_in">text</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span>,</span><br><span class="line">  <span class="string">`send_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'定时发送时间'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'1'</span> <span class="keyword">comment</span> <span class="string">'1 已发送 2 未发送'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'1'</span> <span class="keyword">comment</span> <span class="string">'1 正常 2 定时'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`type`</span> (<span class="string">`type`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`status`</span> (<span class="string">`status`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'手机短信发送记录'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_msg_receive`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  <span class="string">`cus_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'发信人用户id'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">on</span> <span class="keyword">update</span> <span class="keyword">current_timestamp</span> <span class="keyword">comment</span> <span class="string">'修改时间'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'信内容'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'类型1系统通知2站内信'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'0未读1已读2接受3拒绝4黑名单'</span>,</span><br><span class="line">  <span class="string">`receiving_cusid`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'收信人id'</span>,</span><br><span class="line">  <span class="string">`group_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'申请加入群同意之后所需要的字段'</span>,</span><br><span class="line">  <span class="string">`showname`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'会员名'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`cus_id`</span> (<span class="string">`cus_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'站内信'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_msg_system`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">on</span> <span class="keyword">update</span> <span class="keyword">current_timestamp</span> <span class="keyword">comment</span> <span class="string">'修改时间'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'信内容'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'0正常1删除2过期'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'系统消息'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_praise`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键id'</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`target_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'点赞的对象id'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'点赞类型 1问答点赞 2问答评论点赞 3 文章点赞数4 评论点赞'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'所有的点赞表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_questions`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`cus_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建人id'</span>,</span><br><span class="line">  <span class="string">`title`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'问答标题'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'问答内容'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'分类 1课程问答 2 学习分享'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'状态 0可回复1不可回复（采纳最佳答案后改为1 ）'</span>,</span><br><span class="line">  <span class="string">`reply_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'问答回复数量'</span>,</span><br><span class="line">  <span class="string">`browse_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'问答浏览次数'</span>,</span><br><span class="line">  <span class="string">`praise_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'问答点赞数量'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'添加时间'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'问答'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_questions_comment`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键id'</span>,</span><br><span class="line">  <span class="string">`cus_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'评论人id'</span>,</span><br><span class="line">  <span class="string">`question_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'问答id'</span>,</span><br><span class="line">  <span class="string">`content`</span> <span class="built_in">varchar</span>(<span class="number">300</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'评论内容'</span>,</span><br><span class="line">  <span class="string">`is_best`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'是否最佳答案 0否1是'</span>,</span><br><span class="line">  <span class="string">`reply_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'回复数量'</span>,</span><br><span class="line">  <span class="string">`praise_count`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'点赞数'</span>,</span><br><span class="line">  <span class="string">`add_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'回复时间'</span>,</span><br><span class="line">  <span class="string">`comment_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'父级评论id'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'问答评论'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_questions_tag`</span> (</span><br><span class="line">  <span class="string">`questions_tag_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键id'</span>,</span><br><span class="line">  <span class="string">`questions_tag_name`</span> <span class="built_in">varchar</span>(<span class="number">45</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'标签名'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">int</span>(<span class="number">1</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'状态0默认1删除'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建时间'</span>,</span><br><span class="line">  <span class="string">`parent_id`</span> <span class="built_in">varchar</span>(<span class="number">45</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'父级id'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`questions_tag_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'问答标签'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_questions_tag_relation`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'id'</span>,</span><br><span class="line">  <span class="string">`questions_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'问答id'</span>,</span><br><span class="line">  <span class="string">`questions_tag_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'问答标签id'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci ;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_statistics_computer`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`statistics_time`</span> datetime <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'统计日期'</span>,</span><br><span class="line">  <span class="string">`cpu_usage`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'cpu使用率'</span>,</span><br><span class="line">  <span class="string">`memory_usage`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'内存使用率'</span>,</span><br><span class="line">  <span class="string">`net_usage`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'网络使用率'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`statistics_time`</span> (<span class="string">`statistics_time`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'网站统计cpu、磁盘、网络带宽使用率'</span>;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_statistics_day`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`statistics_time`</span> datetime <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'统计日期'</span>,</span><br><span class="line">  <span class="string">`login_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'登录人数（活跃人数 ）'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'生成时间'</span>,</span><br><span class="line">  <span class="string">`registered_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'注册人数'</span>,</span><br><span class="line">  <span class="string">`video_viewing_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'每日播放视频数'</span>,</span><br><span class="line">  <span class="string">`daily_user_number`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'每日用户数'</span>,</span><br><span class="line">  <span class="string">`daily_course_number`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'每日课程数'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`statistics_time`</span> (<span class="string">`statistics_time`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'网站统计日数据'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_teacher`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'教师id'</span>,</span><br><span class="line">  <span class="string">`name`</span> <span class="built_in">varchar</span>(<span class="number">12</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'教师名称'</span>,</span><br><span class="line">  <span class="string">`education`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'教师资历,一句话说明老师'</span>,</span><br><span class="line">  <span class="string">`career`</span> <span class="built_in">text</span> <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'教师简介'</span>,</span><br><span class="line">  <span class="string">`is_star`</span> <span class="built_in">tinyint</span>(<span class="number">1</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'头衔 1高级讲师2首席讲师'</span>,</span><br><span class="line">  <span class="string">`pic_path`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'图片路径'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'状态:0正常1删除'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建时间'</span>,</span><br><span class="line">  <span class="string">`update_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'更新时间'</span>,</span><br><span class="line">  <span class="string">`subject_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'专业id'</span>,</span><br><span class="line">  <span class="string">`sort`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'排序'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>),</span><br><span class="line">  <span class="keyword">key</span> <span class="string">`name`</span> (<span class="string">`name`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COLLATE</span>=utf8_unicode_ci <span class="keyword">COMMENT</span>=<span class="string">'讲师'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_user_login_log`</span> (</span><br><span class="line">  <span class="string">`log_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`login_time`</span> <span class="built_in">timestamp</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'登录时间'</span>,</span><br><span class="line">  <span class="string">`ip`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'登录ip'</span>,</span><br><span class="line">  <span class="string">`user_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'用户id'</span>,</span><br><span class="line">  <span class="string">`os_name`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'操作系统'</span>,</span><br><span class="line">  <span class="string">`user_agent`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'浏览器'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`log_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_course`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`name`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'推荐模块名称'</span>,</span><br><span class="line">  <span class="string">`link`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'点击更多链接'</span>,</span><br><span class="line">  <span class="string">`description`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'说明'</span>,</span><br><span class="line">  <span class="string">`coursenum`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'推荐课程限制数量'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'网站课程推荐分类'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_course_detail`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`recommend_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'推荐分类的id'</span>,</span><br><span class="line">  <span class="string">`course_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程id'</span>,</span><br><span class="line">  <span class="string">`order_num`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'课程显示排序'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'推荐课程表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_ehcache`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">NOT</span> <span class="literal">NULL</span> AUTO_INCREMENT <span class="keyword">COMMENT</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`ehcache_key`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">NOT</span> <span class="literal">NULL</span> <span class="keyword">DEFAULT</span> <span class="string">''</span> <span class="keyword">COMMENT</span> <span class="string">'ehcache key'</span>,</span><br><span class="line">  <span class="string">`ehcache_desc`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">NOT</span> <span class="literal">NULL</span> <span class="keyword">DEFAULT</span> <span class="string">''</span> <span class="keyword">COMMENT</span> <span class="string">'描述'</span>,</span><br><span class="line">  PRIMARY <span class="keyword">KEY</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_images`</span> (</span><br><span class="line">  <span class="string">`image_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`image_url`</span> <span class="built_in">varchar</span>(<span class="number">200</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'图片地址'</span>,</span><br><span class="line">  <span class="string">`link_address`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'图链接地址'</span>,</span><br><span class="line">  <span class="string">`title`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'图标题'</span>,</span><br><span class="line">  <span class="string">`type_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'图片类型'</span>,</span><br><span class="line">  <span class="string">`series_number`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'序列号'</span>,</span><br><span class="line">  <span class="string">`preview_url`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'略缩图片地址'</span>,</span><br><span class="line">  <span class="string">`color`</span> <span class="built_in">varchar</span>(<span class="number">255</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'背景色'</span>,</span><br><span class="line">  <span class="string">`describe`</span> <span class="built_in">varchar</span>(<span class="number">600</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'图片描述'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`image_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'banner图管理'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_images_type`</span> (</span><br><span class="line">  <span class="string">`type_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'类型id'</span>,</span><br><span class="line">  <span class="string">`type_name`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'类型名'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`type_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'图片类型表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_navigate`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'id'</span>,</span><br><span class="line">  <span class="string">`name`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'导航显示名称'</span>,</span><br><span class="line">  <span class="string">`url`</span> <span class="built_in">varchar</span>(<span class="number">100</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'导航显示位置'</span>,</span><br><span class="line">  <span class="string">`newpage`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'是否在新页面打开0是1否'</span>,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'类型：index首页、user个人中心、friendlink尾部友链、tab尾部标签'</span>,</span><br><span class="line">  <span class="string">`ordernum`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'显示排序'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">3</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'0正常1冻结'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'导航表'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_website_profile`</span> (</span><br><span class="line">  <span class="string">`id`</span> <span class="built_in">int</span>(<span class="number">10</span>) <span class="keyword">unsigned</span> <span class="keyword">not</span> <span class="literal">null</span> auto_increment,</span><br><span class="line">  <span class="string">`type`</span> <span class="built_in">varchar</span>(<span class="number">20</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'类型'</span>,</span><br><span class="line">  <span class="string">`desciption`</span> <span class="built_in">text</span> <span class="keyword">comment</span> <span class="string">'内容json格式'</span>,</span><br><span class="line">  <span class="string">`explain`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'说明'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=MyISAM <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 ROW_FORMAT=DYNAMIC;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> <span class="string">`edu_subject`</span> (</span><br><span class="line">  <span class="string">`subject_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">not</span> <span class="literal">null</span> auto_increment <span class="keyword">comment</span> <span class="string">'主键'</span>,</span><br><span class="line">  <span class="string">`subject_name`</span> <span class="built_in">varchar</span>(<span class="number">50</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">''</span> <span class="keyword">comment</span> <span class="string">'专业名称'</span>,</span><br><span class="line">  <span class="string">`status`</span> <span class="built_in">tinyint</span>(<span class="number">1</span>) <span class="keyword">not</span> <span class="literal">null</span> <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'状态 0:默认 1:删除'</span>,</span><br><span class="line">  <span class="string">`create_time`</span> datetime <span class="keyword">default</span> <span class="literal">null</span> <span class="keyword">comment</span> <span class="string">'创建时间'</span>,</span><br><span class="line">  <span class="string">`parent_id`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'父id'</span>,</span><br><span class="line">  <span class="string">`sort`</span> <span class="built_in">int</span>(<span class="number">11</span>) <span class="keyword">default</span> <span class="string">'0'</span> <span class="keyword">comment</span> <span class="string">'排序字段'</span>,</span><br><span class="line">  primary <span class="keyword">key</span> (<span class="string">`subject_id`</span>)</span><br><span class="line">) <span class="keyword">ENGINE</span>=<span class="keyword">InnoDB</span> <span class="keyword">DEFAULT</span> <span class="keyword">CHARSET</span>=utf8 <span class="keyword">COMMENT</span>=<span class="string">'专业信息'</span>;</span><br></pre></td></tr></table></figure>
</section>
    <!-- Tags START -->
    
    <div class="tags">
      <span>Tags:</span>
      
  <a href="/tags#分布式微服务架构">
    <span class="tag-code">分布式微服务架构</span>
  </a>

    </div>
    
    <!-- Tags END -->
    <!-- NAV START -->
    
  <div class="nav-container">
    <!-- reverse left and right to put prev and next in a more logic postition -->
    
      <a class="nav-left" href="/2019/05/24/分布式微服务架构/电子商务系统的设计与实现：数据库设计/">
        <span class="nav-arrow">← </span>
        
          电子商务系统的设计与实现：数据库设计
        
      </a>
    
    
      <a class="nav-right" href="/2019/05/24/分布式微服务架构/百亿级微信红包的高并发资金交易系统设计方案/">
        
          百亿级微信红包的高并发资金交易系统设计方案
        
        <span class="nav-arrow"> →</span>
      </a>
    
  </div>

    <!-- NAV END -->
    <!-- 打赏 START -->
    
    <div class="money-like">
      <div class="reward-btn">
        赏
        <span class="money-code">
          <span class="alipay-code">
            <div class="code-image"></div>
            <b>使用支付宝打赏</b>
          </span>
          <span class="wechat-code">
            <div class="code-image"></div>
            <b>使用微信打赏</b>
          </span>
        </span>
      </div>
      <p class="notice">若你觉得我的文章对你有帮助，欢迎点击上方按钮对我打赏</p>
    </div>
    
    <!-- 打赏 END -->
    <!-- 二维码 START -->
    
    <div class="qrcode">
      <canvas id="share-qrcode"></canvas>
      <p class="notice">扫描二维码，分享此文章</p>
    </div>
    
    <!-- 二维码 END -->
    
    <!-- No Comment -->
    
  </article>
  <!-- Article END -->
  <!-- Catalog START -->
  
  <aside class="catalog-container">
  <div class="toc-main">
    <strong class="toc-title">Catalog</strong>
    
      <ol class="nav">none</ol>
    
  </div>
</aside>
  
  <!-- Catalog END -->
</main>

<script>
  (function () {
    var url = 'https://fengzhaoy.github.io/2019/05/24/分布式微服务架构/教育平台表设计/';
    var banner = ''
    if (banner !== '' && banner !== 'undefined' && banner !== 'null') {
      $('#article-banner').css({
        'background-image': 'url(' + banner + ')'
      })
    } else {
      $('#article-banner').geopattern(url)
    }
    $('.header').removeClass('fixed-header')

    // error image
    $(".markdown-content img").on('error', function () {
      $(this).attr('src', 'http://file.muyutech.com/error-img.png')
      $(this).css({
        'cursor': 'default'
      })
    })

    // zoom image
    $(".markdown-content img").on('click', function () {
      var src = $(this).attr('src')
      if (src !== 'http://file.muyutech.com/error-img.png') {
        var imageW = $(this).width()
        var imageH = $(this).height()

        var zoom = ($(window).width() * 0.95 / imageW).toFixed(2)
        zoom = zoom < 1 ? 1 : zoom
        zoom = zoom > 2 ? 2 : zoom
        var transY = (($(window).height() - imageH) / 2).toFixed(2)

        $('body').append('<div class="image-view-wrap"><div class="image-view-inner"><img src="' + src +
          '" /></div></div>')
        $('.image-view-wrap').addClass('wrap-active')
        $('.image-view-wrap img').css({
          'width': `${imageW}`,
          'transform': `translate3d(0, ${transY}px, 0) scale3d(${zoom}, ${zoom}, 1)`
        })
        $('html').css('overflow', 'hidden')

        $('.image-view-wrap').on('click', function () {
          $(this).remove()
          $('html').attr('style', '')
        })
      }
    })
  })();
</script>


<script>
  var qr = new QRious({
    element: document.getElementById('share-qrcode'),
    value: document.location.href
  });
</script>





    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
  <p class="copyright">
    &copy; 2019
  </p>
</footer>

<script>
  function async (u, c) {
    var d = document,
      t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) {
      o.addEventListener('load', function (e) {
        c(null, e);
      }, false);
    }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async ("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function () {
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async ("//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js", function () {
    $('figure pre').each(function (i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>
<!-- Baidu Tongji -->

<script src="/js/script.js"></script>
  </body>
</html>